#pragma once
#include <vector>

#include "Particle.h"
#include "Plane.h"
#include "Gravity.h"
#include "Spring.h"

#define EPS 5.0f

class Physics
{
protected:
	std::list<Particle>* particles;
	std::list<ForceGenerator*>* forceGenerators;
	Gravity* gravity;

	std::list<LimitedPlane*> collisionPlanes;
	std::list<LinearSpring*> springs;

public:
	Physics(void);
	~Physics(void);

	void init(std::list<Particle>* _particles, std::list<ForceGenerator*>* _forceGenerators, Gravity* gravity);
	
	//void addParticle(Particle* particle);
	//void addForceGenerator(ForceGenerator* forceGen);
	void addCollisionPlane(LimitedPlane* plane);

	void addSpring(LinearSpring* spring);
	void removeSpring(LinearSpring* spring);

	void testCollision(Particle* p, float dt);

	void update(int delta);

};

